﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MuzoBlog.Core.Web.Controls;
using MuzoBlog.Core;
using MuzoBlog.Core.BussinessLogic.Languages;
using System.Web.Security;
using MuzoBlog.Core.Helpers;
using MuzoBlog.Core.BussinessLogic.Settings;

public partial class Login_ : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        btnLogin.Text = LanguageManager.Get("Login.LoginButtonText");
    }

    protected void btnLogin_Click(object sender, EventArgs e)
    {
        Page.Validate();

        if (!Page.IsValid)
            return;

        lblInfo.Text = string.Empty;

        if (!UserManager.Login(txtUserName.Text, txtPassword.Text))
        {
            lblInfo.Text = LanguageManager.Get("Login.UsernameOrPasswordInvalid");
            return;
        }
    }
}